/**
 *	实验二
 *	有两个类：MobileManagement和Mobile，分别描述如图3.7所示两部手机名称及价格，
 *	类MobileManagement在包cn.edu.nwsuaf.jp.p3中，而Mobile在包cn.edu.nwsuaf.jp.p3.data中。
 *	它们代码如下。运行MobileManagement.java，你应该看到如图3.8所示结果。
 */
import javax.swing.JOptionPane;
                               
public class T3E02 {
/** Defines the entry point of the application. */
  public static void main(String[] args) {
	// Creates two mobile phone objects.
	Mobile mobile1 = new Mobile("E365", 1780);
	Mobile mobile2 = new Mobile("M330", 1450);
	
	// Displays the two mobile phones in a dialog box.
	JOptionPane.showMessageDialog(null, "Mobile phones:\n"
		+ mobile1.getName()+" : " + mobile1.getPrice() + "RMB\n"
		+ mobile2.getName()+" : " + mobile2.getPrice() + "RMB\n"
		+ "There are two phones "
			);
  }
}

class Mobile 
{
	private String name;
	private float price;

	public Mobile(String name, float price) 
	{
		this.name = name;
		this.price = price;
	}

	public String getName()
	{
		return name;
	}

	public float getPrice()
	{
		return price;
	}
}